package com.anjian.bamin.anjiandianzimap.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.aiton.administrator.shane_library.shane.ZjbBaseActivity;
import com.anjian.bamin.anjiandianzimap.R;
import com.anjian.bamin.anjiandianzimap.contant.Constant;
import com.anjian.bamin.anjiandianzimap.model.CompanyInfo;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class XunChaActivity extends ZjbBaseActivity {

    @Bind(R.id.imgBack)
    ImageView mImgBack;
    @Bind(R.id.textView_companyName)
    TextView mTextViewCompanyName;
    @Bind(R.id.textView_Address)
    TextView mTextViewAddress;
    @Bind(R.id.line_company_info)
    LinearLayout mLineCompanyInfo;
    private CompanyInfo mCompanyInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xun_cha);
        ButterKnife.bind(this);
        init();
    }
    public static Intent newIntent(Context context, CompanyInfo companyInfo){
        Intent intent = new Intent(context, XunChaActivity.class);
        intent.putExtra(Constant.INTENT_KEY.COMPANYINFO,companyInfo);
        return intent;
    }
    @Override
    protected void initSP() {

    }

    @Override
    protected void initIntent() {
        mCompanyInfo = (CompanyInfo) getIntent().getSerializableExtra(Constant.INTENT_KEY.COMPANYINFO);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void findID() {

    }

    @Override
    protected void initViews() {
        mTextViewCompanyName.setText(mCompanyInfo.getCompanyName());
        mTextViewAddress.setText(mCompanyInfo.getCompanyAddress());
    }

    @Override
    protected void setListeners() {

    }

    @OnClick({R.id.line_company_info})
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.line_company_info:
                Intent intent = CompanyDetialActivity.newIntent(XunChaActivity.this, mCompanyInfo,false);
                startActivityTo(intent);

                break;
        }
    }
}
